/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package sv.com.bolsaTrabajo.model.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author sysmanager
 */
@Embeddable
public class IdiomaPersonaPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_idioma", nullable = false)
    private int idIdioma;
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_persona", nullable = false)
    private int idPersona;

    public IdiomaPersonaPK() {
    }

    public IdiomaPersonaPK(int idIdioma, int idPersona) {
        this.idIdioma = idIdioma;
        this.idPersona = idPersona;
    }

    public int getIdIdioma() {
        return idIdioma;
    }

    public void setIdIdioma(int idIdioma) {
        this.idIdioma = idIdioma;
    }

    public int getIdPersona() {
        return idPersona;
    }

    public void setIdPersona(int idPersona) {
        this.idPersona = idPersona;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idIdioma;
        hash += (int) idPersona;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof IdiomaPersonaPK)) {
            return false;
        }
        IdiomaPersonaPK other = (IdiomaPersonaPK) object;
        if (this.idIdioma != other.idIdioma) {
            return false;
        }
        if (this.idPersona != other.idPersona) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sv.com.bolsaTrabajo.controller.IdiomaPersonaPK[ idIdioma=" + idIdioma + ", idPersona=" + idPersona + " ]";
    }
    
}
